<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta name="copyright" content="http://www.appcms.org" />
<link rel="stylesheet" href="skin/base.css">
<script src="js/zy_control.js"></script>
<script src="js/zy_click.js"></script>
<script src="js/config.js"></script>
<style>
body {
	background-color: #343434;
}
#main {
	background: url(skin/images/welcome.jpg) no-repeat center;
	-webkit-background-size: auto 100%;
	background-size: auto 100%;
}
</style>
</head>
<body>
<div id="main" ontouchstart="zy_touch('act')" onclick="ok()"></div>
</body>
	<script>
	zy_init();
	var statusok = false;
	function ok(){
		if (statusok) {
			add20head();
			localStorage['version'] = version;
			uexWindow.evaluateScript('root', 0, 'welcomeOk()');
			uexWindow.close(0);
		}else{
			main();
		}
	}
	
	function add20head(){
		if (parseInt(localStorage['device']) == 0) {
			uexDevice.cbGetInfo = function(opId, dataType, data){
				if (data) {
					var device = JSON.parse(data);
					var os = parseInt(device.os);
					if (os >= 7) {
						localStorage['add20head'] = '1';
					}
				}
			}
			uexDevice.getInfo('1');
		}
	}
	
	function main(){
		localStorage.clear();
		if (typeof(uexWidgetOne.getPlatform()) != "undefined") {
			localStorage['device'] = uexWidgetOne.getPlatform();
		}else{
			localStorage['device'] = 999;
		}
		
		
		
		
		var url = app_path + 'index.php?m=iapp&c=app&a=setting';
		uexXmlHttpMgr.open(0, 'post', url, "8000");
		uexXmlHttpMgr.send(0);
	}
	
	window.uexOnload = function(type){
	 	if (!type) {
			uexXmlHttpMgr.onData = function(opId, status, data){
				uexXmlHttpMgr.close(opId);
				if (status == 1) {
					data=JSON.parse(data);
					if (data['success'] == 'yes') {
						statusok = true;

						localStorage['skin'] = data['data']['skin'];
						localStorage['bg'] = data['data']['bg'];
						localStorage['config'] = data['data']['config'];

						if (localStorage['device'] == 0) {
							if(k_v(data['data']['upgrade']['new_iphone_ver'])){
								uexWindow.confirm('软件更新', '发现新版本'+data['data']['upgrade']['new_iphone_ver']+',是否现在更新？', ["更新", "稍后"]);
								uexWindow.cbConfirm = function(cbopId, dataType, cbdata){
									if (cbdata == 0) {
										loadLink(data['data']['upgrade']['iphone_updateFileUrl']);
									}else {
										return;
									}
								}
							}
						}else if (localStorage['device'] == 1) {
							if(k_v(data['data']['upgrade']['new_android_ver'])){
								uexWindow.confirm('软件更新', '发现新版本'+data['data']['upgrade']['new_android_ver']+',是否现在更新？', ["更新", "稍后"]);
								uexWindow.cbConfirm = function(cbopId, dataType, cbdata){
									if (cbdata == 0) {
										loadLink(data['data']['upgrade']['android_File']);
									}else {
										return;
									}
								}
							}
						}
					}else{
						uexWindow.toast("0","5",'初始化失败,请重新启动程序！',1000);
					}
				}else if(status==-1){
					uexXmlHttpMgr.close(opId);
					uexWindow.toast("0","5",'初始化失败,请重新启动程序！',1000);
				}
			}
			
			main();
	 	}
	 }
	 
	</script>
</html>